<script setup>
  import { func } from '../../uni_modules/uview-plus/libs/function/test'
  const { windowHeight } = uni.getWindowInfo()

  const emit = defineEmits(['scrolltolower', 'refresherrefresh', 'ccc'])

  const scrpge = defineProps({
    borderTopColor: {
      type: String,
      default: '#fff',
    },
    isrefresherEnable: {
      type: Boolean,
      default: false,
    },
    isrefresherTriggered: {
      type: Boolean,
      default: false,
    },
    backgroundColor: {
      type: String,
      default: '#fff',
    },
  })
</script>

<template>
  <scroll-view
    scroll-y
    :refresher-enabled="isrefresherEnable"
    :refresher-triggered="isrefresherTriggered"
    :show-scrollbar="false"
    lower-threshold="50"
    :style="{
      borderBottom: `1px solid ${scrpge.borderTopColor}`,
      backgroundColor: scrpge.backgroundColor,
      height: windowHeight + 'px',
    }"
    @scrolltolower="emit('scrolltolower', $event)"
    @refresherrefresh="emit('refresherrefresh', $event)"
    class="myt"
  >
    <view class="myview">
      <slot></slot>
    </view>
  </scroll-view>
</template>

<style lang="scss">
  .myview {
    padding-bottom: env(safe-area-inset-bottom);
  }
</style>
